<template>
	<view :style="[{paddingTop:CustomBar+'px'}]">
		<cu-custom bgColor="bg-colorP" :isBack="true">
			<block slot="backText"></block>
			<block slot="content">我的评价</block>
		</cu-custom>
		<view class="ticket-content">
			<view class="tab-view">
				<view v-for="(item,index) in tabbar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']"
				 :data-current="index" @tap.stop="swichNav">
					{{item}}
					<view class="bottom-tab" v-if="currentTab==index"></view>
				</view>
			</view>
			<swiper class="tab-content" :current="currentTab" duration="300" @change="switchTab" :style="{height:winHeight+'px'}">
				<swiper-item>
					<!-- :lower-threshold="'200'"  @scrolltolower=""  离底部200px的时候走的请求 -->
					<scroll-view scroll-y class="scoll-y">
						<!-- <no-content :showType="'data'" v-if="pendingCont" :tips="'您还没有相关订单'"></no-content> -->
						<!-- <tui-divider width="60%" :gradual="true" v-if="pendingList.length>0">没有更多了~</tui-divider> -->
					</scroll-view>
				</swiper-item>
				<swiper-item>
					<!-- <no-content :showType="'data'" v-if="tNoCont" :tips="'您还没有相关订单'"></no-content> -->
					<!-- <tui-divider width="60%" :gradual="true" v-if="toSendList.length>0">没有更多了~</tui-divider> -->
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<!-- :lower-threshold="'200'"  @scrolltolower=""  离底部200px的时候走的请求 -->
		<scroll-view scroll-y class="scoll-y">
			<view class="order-list">
				<view class="shops-head">
					<image src="https://xarkbucket.oss-cn-hangzhou.aliyuncs.com/resources/default-store.png" mode=""></image>
					<text>格格巫的猫店</text>
				</view>
				<view class="pro-list">
					<view class="pro-item">
						<image src="https://xarkbucket.oss-cn-hangzhou.aliyuncs.com/resources/photo1.jpg" mode=""></image>
						<view class="pro-info">
							<view class="">
								灰色猫床猫窝四季通用冬季保暖小猫夏季深度睡眠猫咪别
							</view>
							<view class="">
								<view class="">
									<text class="text-price text-colorP">20</text>
									<text class="text-colorP">+</text>
									<text class="text-colorP">30积分</text>
								</view>
								<view class="">
									x1
								</view>
							</view>
						</view>
					</view>
					<view class="pro-item">
						<image src="https://xarkbucket.oss-cn-hangzhou.aliyuncs.com/resources/photo1.jpg" mode=""></image>
						<view class="pro-info">
							<view class="">
								灰色猫床猫窝四季通用冬季保暖小猫夏季深度睡眠猫咪别
							</view>
							<view class="">
								<view class="">
									<text class="text-price text-colorP">20</text>
									<text class="text-colorP">+</text>
									<text class="text-colorP">30积分</text>
								</view>
								<view class="">
									x1
								</view>
							</view>
						</view>
					</view>
					<view class="bottom-btn">
						<view class="">
							查看详情
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				CustomBar: this.CustomBar,
				currentTab: '',
				tabbar: ['待处理', '已完成'],
				winHeight: ''
			}
		},
		onLoad() {
			var that = this
			setTimeout(() => {
				uni.getSystemInfo({
					success: function(res) {
						let winHeight = res.windowHeight - that.CustomBar - 44;
						that.winHeight = winHeight;
					}
				})
			}, 10)
		},
		methods: {
			// 滚动切换标签样式
			switchTab: function(e) {
				let that = this;
				this.currentTab = e.detail.current;
			},
			// 点击标题切换当前页时改变样式
			swichNav: function(e) {
				let cur = e.currentTarget.dataset.current;
				if (this.currentTab == cur) {
					return false;
				} else {
					this.currentTab = cur
				}
			},
		}
	}
</script>

<style scoped>
	.ticket-content {
		width: 100%;
		overflow: hidden
	}

	/*tabbar start*/
	::-webkit-scrollbar {
		width: 0;
		height: 0;
		color: transparent;
	}

	.tab-view::before {
		content: '';
		border-bottom: 1upx solid #eaeef1;
		-webkit-transform: scaleY(0.5);
		transform: scaleY(0.5);
	}

	.tab-view {
		width: 100%;
		height: 88upx;
		overflow: hidden;
		background: #fff;
		display: flex;
		justify-content: center;
		border-bottom: solid 1rpx #efefef;
		box-sizing: border-box;
	}

	.tab-bar-item {
		height: 88upx;
		width: 123upx;
		line-height: 88upx;
		text-align: center;
		box-sizing: border-box;
		background-color: #ffffff;
		box-sizing: border-box;
		color: #333333;
		font-size: 30rpx;
		flex: 1;
		position: relative;
		overflow: hidden;
	}

	.tab-bar-item .bottom-tab {
		position: absolute;
		bottom: -2rpx;
		left: 50%;
		margin-left: -165rpx;
		width: 330rpx;
		height: 10rpx;
		background-color: #f34930;
		border-radius: 6rpx 6rpx 0px 0px
	}

	.active {
		color: #f34930;
		font-weight: bold;
	}

	/*tabbar end*/
	.scoll-y {
		height: 100%;
		/* padding: 0 24rpx; */
		box-sizing: border-box;
	}


	.order-list {
		width: 700rpx;
		padding: 20rpx 20rpx;
		box-sizing: border-box;
		background: #fff;
		margin: 0 auto 30rpx;
	}

	.order-list:first-child {
		margin-top: 30rpx;
	}

	.order-list .shops-head {
		width: 100%;
		display: flex;
		align-items: center;
	}

	.order-list .shops-head image {
		width: 48rpx;
		height: 48rpx;
		background-color: #f34930;
		border-radius: 4rpx;
		margin-right: 15rpx;
	}

	.order-list .shops-head text {
		color: #333333;
		font-size: 28rpx;
	}

	.order-list .pro-list {
		width: 100%;
	}

	.pro-list .pro-item {
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
		padding: 10rpx 0;
	}

	.pro-list .pro-item:first-child {
		padding-top: 20rpx;
	}

	.pro-list .pro-item image {
		width: 200rpx;
		height: 188rpx;
		background-color: #f0c4a0;
		border-radius: 8rpx;
		margin-right: 18rpx;
	}

	.pro-list .pro-item .pro-info {
		flex: 1;
		height: 188rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.pro-list .pro-item .pro-info>view:nth-child(1) {
		font-size: 30rpx;
		letter-spacing: 1rpx;
		color: #333333;
	}

	.pro-list .pro-item .pro-info>view:nth-child(2) text,
	.pro-list .pro-item .pro-info>view:nth-child(2) view {
		color: #333333;
		font-size: 24rpx;
	}

	.pro-list .pro-item .pro-info>view:nth-child(2) {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.bottom-btn {
		display: flex;
		justify-content: flex-end;
		align-items: center;
		width: 100%;
		margin-top: 20rpx;
	}

	.bottom-btn>view {
		width: 169rpx;
		height: 48rpx;
		background-color: #ffffff;
		border-radius: 8rpx;
		border: solid 1rpx #999999;
		font-size: 30rpx;
		letter-spacing: 1rpx;
		color: #999999;
		text-align: center;
		line-height: 48rpx;
		margin-right: 20rpx;
	}

	.bottom-btn>view:last-child {
		border: solid 1rpx #f34930;
		color: #f34930;
		margin-right: 0;
	}
</style>
